package com.x.xiaoshuo.ui.read;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.x.mvp.appbar.AppBarFragment;
import com.x.mvp.base.view.activity.ActivityView;
import com.x.xiaoshuo.R;
import com.x.xiaoshuo.di.XActivityComponent;
import com.x.xiaoshuo.ui.appbar.LeftTitleAppBarBuilder;


public class AgreementActivity extends ActivityView<AgreementPresenter> {

    LeftTitleAppBarBuilder leftTitleAppBarBuilder;

    public static void startActivity(Context context) {
        context.startActivity(new Intent(context, AgreementActivity.class));
    }

    @Override
    protected void injectComponent() {
        ((XActivityComponent) getActivityComponent()).inject(this);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_agreement_zm;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initView();
    }

    void initView() {
        AppBarFragment appBarFragment = new AppBarFragment().setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        }).setBackGroundColor(R.color.red);
        appBarFragment.setArguments(AppBarFragment.getStartParams(AppBarFragment.TYPE_SECOND_FRAGMENT,
                "转码声明"));
        getSupportFragmentManager().beginTransaction()
                .replace(R.id.appbar_container, appBarFragment)
                .commitAllowingStateLoss();

    }
}
